/**
 * @Author xieha
 * @Email xiehao35755@163.com
 * @Date 2020-02-12 22:40
 */


package com.xh.blog.article.web.controller;

import com.xh.blog.article.model.dto.ArticleRequest;
import com.xh.blog.article.service.ArticleService;
import com.xh.blog.common.wrapper.ResponseWrapper;
import com.xh.blog.user.model.dto.UserInfoDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by xieha on 2020-02-12.
 */
@Controller
@RequestMapping("/api/open/article")
public class ArticleController {
    @Autowired
    ArticleService articleService;

    @ResponseBody
    @PostMapping("/add")
    @ApiOperation(value = "增加文章接口")
    public ResponseWrapper<Long> addArticle(@RequestBody  ArticleRequest articleRequest){
       return ResponseWrapper.getInstance().success( articleService.addArticle(articleRequest));
    }

}
